#ifndef TITLEBAR_H
#define TITLEBAR_H
#include "./module/aboutdialog.h"
#include "./module/savepathdialog.h"
#include "fileProcess/fileprocess.h"

#include <QObject>
#include <QWidget>
#include <QFrame>
#include <QToolButton>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QMenu>

class TitleBar : public QWidget
{
    Q_OBJECT
public:
    explicit TitleBar(QWidget *parent = nullptr);
    void toggleMaximize();
    QPushButton *m_gohomebtn = nullptr;

    void setGoHomeBtn(bool isable);
signals:
    void gohomesignal(); // 声明自定义信号
    void savePathUpdate(const QString& filePath);
protected:
    void mouseDoubleClickEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);

private:
    bool m_ismaximized;
    QToolButton *m_optionbtn = nullptr; // 菜单选项
    QPushButton *m_minimumbtn = nullptr;
    QPushButton *m_maximumbtn = nullptr;
    QPushButton *recoverNormalSizeBtn = nullptr;
    QPushButton *m_closebtn = nullptr;
    SavePathDialog *m_savepathdlg;

    bool isMaximizedDuringDrag() const;
};

#endif // TITLEBAR_H
